const baseURL = 'http://121.37.209.61:3000'

const request = function (t,options) {
  return new Promise((resolve, reject) => {
    const {url,method,data} = t
    wx.request({
      ...Object.assign({url:baseURL + url,method,data},options),
      success(res) {
        resolve(res.data)
      },
      fail(err) {
        reject(err)
      }
    })
  })
}
module.exports = {request}